import threading
from time import sleep
import os

def fun(sec, name):
    print("子线程执行")
    sleep(sec)
    print(f"T: {name}")


lie = []
for i in range(5):
    so = threading.Thread(target=fun, args=(2,), kwargs={'name':f"{i}"}) # 实例化
    so.start()  # 开始
    lie.append(so) # 追加

if lie:
    [i.join() for i in lie] # 回收
print("123")